unit shbl_Filter;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, shbl_Card, PropFilerEh, PropStorageEh, ActnList, Menus,
  StdCtrls, Buttons, ExtCtrls, ComCtrls, DBCtrlsEh;

type
  TshblFilter = class(TshblCard)
    aFilterClear: TAction;
    BitBtn1: TBitBtn;
    procedure aFilterClearExecute(Sender: TObject);
  private
    { Private declarations }
  public

  end;

var
  shblFilter: TshblFilter;

procedure UncheckBoxes(Parent : TWinControl);
  
implementation

uses MAIN;

{$R *.dfm}
procedure UncheckBoxes(Parent : TWinControl);
var i, j :integer;
begin
  for i := 0 to Parent.ControlCount - 1 do begin
    if not Parent.Controls[i].InheritsFrom(TWinControl) then
      continue;

    if (Parent.Controls[i] as TWinControl).ControlCount > 0 then begin
      if Parent.Controls[i].ClassNameIs('TPageControl') then begin
        for j:= 0 to (Parent.Controls[i] as TPageControl).PageCount - 1 do begin
          UncheckBoxes((Parent.Controls[i] as TPageControl).Pages[j] as TWinControl);
        end;
      end
      else
        UncheckBoxes((Parent.Controls[i] as TWinControl));
    end;
    if not Parent.Controls[i].ClassNameIs('TDBCheckBoxEh') then continue;
    (Parent.Controls[i] as TDBCheckBoxEh).Checked := false;
  end;
end;

procedure TshblFilter.aFilterClearExecute(Sender: TObject);
begin
  UncheckBoxes(Self);
end;

end.
